 
layui.define(['form','xmSelect'], function(exports){
	 var $ = layui.$
	    ,form = layui.form
	    ,setter = layui.setter
	    ,laydate = layui.laydate
	    ,xmSelect = layui.xmSelect;
	    var groupSelect = xmSelect.render({
			el: '#groupSelect', 
			autoRow: true,
			name:'groupId',
			radio: true,
			clickClose: true,
			tree: {
				show: true,
				showFolderIcon: true,
				showLine: true,
				strict: false,
				indent: 20,
				expandedKeys: [ -1 ],
			},
			height: 'auto',
			on: function(data){
				if(data.isAdd){
					$('#groupSelect').find("input[name=groupId]").val(data.change[0].value);
				}
			}
		});
	  $.ajax({
		  url: setter.host+'/adminmanager/group/getTreeSelect'
	      ,type:'post'
	      ,dataType:'json'
	      ,success: function(res){
	        //请求成功后
	    	  if(res.status == setter.response.statusCode.status_Success){
	    		  groupSelect.update({
		      		  data: res.data,
		      		  autoRow: true,


		      	  })
	    	  }else{
	    		  layer.msg(res.msg);
	    	  }
	      }
	  });
	    
  //对外暴露的接口
    exports('insert', {});
});